﻿//设置本地导航
function setLocalToParent(type) {

    var items = $(".localTitle").find("a");
    var localStr;
    if (type == 1) {
        localStr = "你当前所在位置:学校管理中心 &gt;&gt; ";
    } else {
        localStr = "你当前所在位置:教育局管理中心 &gt;&gt; ";
    }

    items.each(function (n) {
        if (n < items.length - 1) {
            localStr += "<span style='font-family:宋体'>" + $(this).html() + "&nbsp;&gt;&nbsp;</span>";
        } else {
            localStr += "<span style='font-family:宋体;color:#ff0000'>" + $(this).html() + "</span>";
        }
    });

    $(".panel_cnt_local", window.parent.document).html(localStr);
}

//隔行样式处理
function InterDiscolor(targetID, isChanage) {
    //奇行样式与偶行样式
    if (isChanage) {
        var oddColor = "tableSRowColor";
        var evenColor = "tableRowColor";
    } else {
        var oddColor = "tableRowColor";
        var evenColor = "tableSRowColor";
    }

    var targetID = "#" + targetID

    $(targetID + ' tr:odd').addClass(evenColor); //奇行变色
    $(targetID + ' tr:even').addClass(oddColor); //偶行变色 
}

//获取年份列表 参数target:传入的下拉列表框控件
function GetYearList(target) {
    var startYear = 2010;
    var endYear = new Date().getFullYear();
    for (var i = endYear; i >= startYear; i--) {
        target.append("<option value='" + i + "'>" + i + "年</option>");
    }
}
//去除空格和换行
function replaceSpan(str) {
    return str.replace(/(^\s*)|(\s*$)/g, "");
}

